<!-- 查看sop配置 -->
<template>
  <div>
    <dt-modal-info ref='info' :title='title' :label-width='100' :width='70'>
      <div class='project_report_check_sop'>
        <Row type='flex' justify="start" class="sop_content">
          <Col span="8" v-for="(item,index) in SopSort" :key="index">
          <Row type='flex' justify="start" class="item_class">
            <Col span="16">
            {{item.name}}
            </Col>
            <Col span="8">
            <span class="badge_warp" v-if="clickType=='1'">
              <Badge :status="item.isAssess=='1'?'success':'error'" />
              {{item.isAssess=='1'?openTaskTxt:closeTaskTxt}}
            </span>
            <span class="badge_warp" v-else>
              <Badge :status="item.isAssess=='1'?'success':'error'" />
              {{item.isAssess=='1'?openTxt:closeTxt}}
            </span>
            </Col>
          </Row>
          </Col>
        </Row>
      </div>
    </dt-modal-info>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        title: '',
        SopSort: [],
        clickType: '',
        openTaskTxt: '生成任务',
        closeTaskTxt: '不生成任务',
        openTxt: '扣分',
        closeTxt: '不扣分'
      };
    },
    methods: {
      show(data) {
        this.title = data.title;
        this.clickType = data.clickType
        this.init(data)
        this.$refs.info.show();
      },
      init(data) {
        this.SopSort = []
        if (this.clickType == '1') {
          this.SopSort = data.tasksItemList
        } else {
          this.SopSort = data.deductPointsItemList
        }
      },
    }
  }
</script>
<style lang='scss' scoped>
  .project_report_check_sop {

    .sop_content {
      margin-bottom: 30px;

      .item_class {
        padding: 15px 0;
        font-size: 16px;
        line-height: 30px;
      }
    }

    ::v-deep .ivu-badge-status-dot {
      width: 10px;
      height: 10px;
    }
  }
</style>